@extends('admin.layout')
@section('body')
    <!-- 正文开始 -->
    <div class="layui-fluid">
        <div class="layui-card">
            <div class="layui-card-body">
                <!-- 表格工具栏 -->
                <form class="layui-form toolbar" id="formSearch">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">年:</label>
                            <div class="layui-input-inline">
                                <select name="year">
                                    @for ($i =date('Y'); $i>=date('Y')-4; $i--)
                                        <option value="{{ $i }}">{{ $i }}</option>
                                    @endfor
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">月:</label>
                            <div class="layui-input-inline">
                                <select name="month">
                                    @for ($i =1; $i<=12; $i++)
                                        <option value="{{ $i }}" @if($i==date('m')) selected @endif>{{ $i }}月</option>
                                    @endfor
                                </select>
                            </div>
                        </div>
                        <div class="layui-inline">&emsp;
                            <button class="layui-btn icon-btn" lay-filter="searchForm" lay-submit>
                                <i class="iconfont icon-ic_search"></i>@lang('common.search')
                            </button>
                        </div>
                    </div>
                </form>
                <!-- 数据表格 -->
                <table id="adminTable" lay-filter="adminTable"></table>
            </div>
        </div>
    </div>
@stop
@push('script')
    <script type="text/javascript">
        layui.use(['layer', 'form', 'table', 'util', 'admin'], function () {
            let listTableInc = new ListTable("{{admin_url($baseRoute.'pager')}}");
            listTableInc.checkbox();
            listTableInc.lineNumber().title = '排名';
            listTableInc.column("名称", "name");
            listTableInc.column("汇总", "count");
            listTableInc.render();
            window.listTableInc = listTableInc;
        });
    </script>
@endpush
